package com.zerox.service.impl;

import com.zerox.mapper.SupplierMapper;
import com.zerox.pojo.Supplier;
import com.zerox.pojo.SysUser;
import com.zerox.service.SupplierService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SupplierServiceImpl implements SupplierService {

    @Autowired
    private SupplierMapper supplierMapper;

    @Override
    public List<Supplier> list(String supContact, Integer pageNo, Integer pageSize) {

        return supplierMapper.list(supContact,(pageNo-1)*pageSize,pageSize);
    }

    @Override
    public int add(Supplier supplier) {
        return supplierMapper.add(supplier);
    }

    @Override
    public Supplier selectById(Integer id) {
        return supplierMapper.selectById(id);
    }

    @Override
    public int delete(Integer id) {
        return supplierMapper.delete(id);
    }

    @Override
    public int count(String supContact) {

        return supplierMapper.count(supContact);
    }

    @Override
    public int updateById(Supplier supplier) {
        return supplierMapper.updateById(supplier);
    }

    @Override
    public int selectBysupCode(String supCode) {
        return supplierMapper.selectBysupCode(supCode);
    }

    @Override
    public int selectBySupName(String supName) {
        return supplierMapper.selectBySupName(supName);
    }
}
